home *** CD-ROM | disk | FTP | other *** search
/ PC Home 62 / PC Home 62.iso / mosby.mst < prev    next >
Text File  |  1995-01-10  |  16KB  |  516 lines

  1. '**************************************************************************
  2. '*                       Mosby Setup
  3. '**************************************************************************
  4.  
  5. '$DEFINE DEBUG  ''Define for script development/debugging
  6.  
  7. '$INCLUDE 'setupapi.inc'
  8. '$INCLUDE 'msdetect.inc'
  9.  
  10. ''Dialog ID's
  11. CONST ASKQUIT      = 200
  12. CONST DESTPATH     = 300
  13. CONST EXITFAILURE  = 400
  14. CONST EXITQUIT     = 600
  15. CONST EXITSUCCESS  = 700
  16. CONST OPTIONS      = 800
  17. CONST APPHELP      = 900
  18. CONST CUSTINST     = 6200
  19. CONST TOOBIG       = 6300
  20. CONST BADPATH      = 6400
  21.  
  22. ''Bitmap ID
  23. 'CONST LOGO         = 1
  24.  
  25. ''File Types
  26. CONST APPFILES     = 1
  27. CONST OPTFILES1    = 2
  28.  
  29.  
  30. '' Font setup
  31. CONST WM_FONTCHANGE = 29
  32. CONST HWND_BROADCAST = -1
  33.  
  34. DECLARE FUNCTION CreateScalableFontResource LIB "GDI.EXE" (fHidden%, FOTFile$, TTFFile$, SysDir$) AS INTEGER
  35. DECLARE FUNCTION AddFontResource LIB "GDI.EXE" (FOTFiles$) AS INTEGER
  36. DECLARE FUNCTION  SendMessage LIB "USER.EXE" (hWnd%, Message%, wParam%, lParam&) AS LONG
  37.  
  38.  
  39. GLOBAL DEST$        ''Default destination directory.
  40. GLOBAL SRCDRV$      ''Source drive.
  41. GLOBAL TESTDIR$      
  42. GLOBAL WINDRIVE$    ''Windows drive letter.
  43. GLOBAL OPT1OPT$     ''Option selection from OptFiles1 option dialog.
  44.  
  45. GLOBAL WINDIR$
  46.  
  47. ''CustInst list symbol names
  48. GLOBAL APPNEEDS$    ''Option list costs per drive
  49. GLOBAL OPT1NEEDS$
  50.  
  51. GLOBAL EXTRACOSTS$  ''List of extra costs to add per drive
  52. GLOBAL BIGLIST$     ''List of option files cost calc results (boolean)
  53. GLOBAL DRVLIST$ 
  54.  
  55. ''Dialog list symbol names
  56. GLOBAL CHECKSTATES$
  57. GLOBAL STATUSTEXT$
  58. GLOBAL DRIVETEXT$
  59.  
  60.  
  61. DECLARE SUB AddOptFilesToCopyList (ftype%)
  62. DECLARE SUB RecalcOptFiles (ftype%)
  63. DECLARE SUB RecalcPath
  64. DECLARE SUB SetDriveStatus
  65. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  66. WinDir$ = getWindowsDir()
  67.  
  68. INIT:
  69.     CUIDLL$ = "mscuistf.dll"            ''custom user interface dll
  70.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  71.     DRVLIST$ = "DrvList"
  72. '    SetBitmap CUIDLL$, LOGO
  73.     SetTitle "Mosby Medical Encyclopedia"
  74.  
  75.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  76.     IF szInf$ = "" THEN
  77.     szInf$ = GetSymbolValue("STF_CWDDIR") + "MOSBY.INF"
  78.     END IF
  79.     ReadInfFile szInf$
  80.  
  81.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  82.  
  83.     DEST$ = WINDRIVE$ + ":\MOSBY"
  84.  
  85.     SRCDRV$ = GetSymbolValue("STF_SRCDIR")   
  86.  
  87.     ''CustInst list symbols
  88.     CHECKSTATES$ = "CheckItemsState"
  89.     STATUSTEXT$  = "StatusItemsText"
  90.     DRIVETEXT$   = "DriveStatusText"
  91.     FOR i% = 1 TO 3 STEP 1
  92.     AddListItem CHECKSTATES$, "ON"
  93.     NEXT i%
  94.     FOR i% = 1 TO 3 STEP 1
  95.     AddListItem STATUSTEXT$, ""
  96.     NEXT i%
  97.     FOR i% = 1 TO 7 STEP 1
  98.     AddListItem DRIVETEXT$, ""
  99.     NEXT i%
  100.     ReplaceListItem DRIVETEXT$, 7, DEST$
  101.  
  102.     ''Disk cost list symbols
  103.     APPNEEDS$   = "AppNeeds"
  104.     OPT1NEEDS$  = "Opt1Needs"
  105.     EXTRACOSTS$ = "ExtraCosts"
  106.     BIGLIST$    = "BigList"
  107.     FOR i% = 1 TO 3 STEP 1
  108.     AddListItem BIGLIST$, ""
  109.     NEXT i%
  110.     FOR i% = 1 TO 26 STEP 1
  111.     AddListItem EXTRACOSTS$, "0"
  112.     NEXT i%
  113.  
  114.     ''File Option Variables
  115.     OPT1OPT$ = "1"
  116.     OPT2OPT$ = "1"
  117.  
  118.     RecalcPath
  119.     SetDriveStatus
  120.  
  121. '$IFDEF DEBUG
  122.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  123. '$ENDIF ''DEBUG
  124.  
  125.  
  126.  
  127. CUSTINST:
  128.     sz$ = UIStartDlg(CUIDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$)
  129.  
  130.     IF sz$ = "CONTINUE" THEN
  131.     ''Install only if it will fit.
  132.     FOR i% = 1 TO 3 STEP 1
  133.         IF GetListItem(BIGLIST$, i%) <> "" THEN
  134.         GOSUB TOOBIG
  135.         GOTO CUSTINST
  136.         END IF
  137.     NEXT i%
  138.     UIPop 1
  139.     GOTO INSTALL
  140.     ELSEIF sz$ = "PATH" THEN
  141.     GOTO GETPATH
  142.     ELSEIF sz$ = "CHK1" THEN
  143.     RecalcOptFiles APPFILES
  144.     SetDriveStatus
  145.     GOTO CUSTINST
  146.     ELSEIF sz$ = "CHK2" THEN
  147.     RecalcOptFiles OPTFILES1
  148.     SetDriveStatus
  149.     GOTO CUSTINST
  150.     ELSEIF sz$ = "BTN2" THEN
  151.     GOTO OPTFILES1
  152.    ELSEIF sz$ = "REACTIVATE" THEN
  153.     RecalcPath
  154.     SetDriveStatus
  155.     GOTO CUSTINST
  156.     ELSE
  157.     GOSUB ASKQUIT
  158.     GOTO CUSTINST
  159.     END IF
  160.  
  161.  
  162.  
  163. INSTALL:
  164.     ClearCopyList
  165.     AddOptFilesToCopyList APPFILES
  166.     AddOptFilesToCopyList OPTFILES1
  167.     CreateDir DEST$, cmoNone
  168.     CopyFilesInCopyList
  169.     
  170.  
  171.     SYSDIR$=GetWindowsSysDir()
  172.  
  173.  
  174.     IF GetListItem(CHECKSTATES$, APPFILES) = "ON" THEN
  175.     ini$ = MakePath(GetWindowsDir(), "WIN.INI")
  176.     CreateIniKeyValue ini$, "fonts", "Mosby (TrueType)", "MOSBY.FOT", cmoOverwrite
  177.     ini$ = ""
  178.     ini$ = MakePath(GetWindowsDir(), "MOSBY.INI")
  179.     CreateIniKeyValue ini$, "Program", "Path", DEST$, cmoOverwrite
  180.     CreateIniKeyValue ini$, "Table", "Path",   SRCDRV$ + "mosby\table", cmoOverwrite
  181.     CreateIniKeyValue ini$, "Appendix", "Path",  SRCDRV$ + "mosby\appendix", cmoOverwrite
  182.     CreateIniKeyValue ini$, "Picture", "Path",  SRCDRV$ + "mosby\picture", cmoOverwrite
  183.     CreateIniKeyValue ini$, "Media", "Path",  SRCDRV$ + "mosby\media", cmoOverwrite
  184.     CreateIniKeyValue ini$, "Atlas", "Path",  SRCDRV$ + "mosby\mosbypic\atlas", cmoOverwrite
  185.     CreateIniKeyValue ini$, "ProgramPicture",  "Path", SRCDRV$ + "mosby\mosbypic\used", cmoOverwrite
  186.     CreateIniKeyValue ini$, "SidePicture", "Path",  SRCDRV$ + "mosby\mosbypic\sidepic", cmoOverwrite
  187.     CreateIniKeyValue ini$, "WordList", "Path",  DEST$ + "\wordlist", cmoOverwrite
  188.  
  189.     CreateIniKeyValue ini$, "Sound", "Path",  SRCDRV$ + "MOSBY\sound", cmoOverwrite
  190.  
  191.     CreateIniKeyValue ini$, "RDatabase", "Path",  SRCDRV$ + "mosby\db", cmoOverwrite
  192.     CreateIniKeyValue ini$, "KeySearch", "Path",  SRCDRV$ + "MOSBY\db", cmoOverwrite
  193.  
  194.     CreateIniKeyValue ini$, "HD", "Value",  "1", cmoOverwrite
  195.     ini$ = ""
  196.     CreateProgmanGroup "Mosby Multimedia", "", cmoNone
  197.     ShowProgmanGroup  "Mosby Multimedia", 1, cmoNone
  198.  
  199.     CreateProgmanItem "Mosby Multimedia", "Mosby Medical Encyclopedia", MakePath(DEST$,"MOSBY.exe"), SRCDRV$ + "SETUP.ICO", cmoOverwrite
  200.     CreateProgmanItem "Mosby Multimedia", "README Encyclopedia Tips", MakePath(GetWindowsDir(),"WRITE.EXE ")+MakePath(DEST$,"ENCYTIPS.WRI"), "", cmoOverwrite
  201.  
  202.     i%=CreateScalableFontResource (0,SYSDIR$+"mosby.fot", "mosby.ttf", SYSDIR$)
  203.     i%=AddFontResource (SYSDIR$+"mosby.fot")
  204.  
  205.     FontName$=STRING$ (64, 32)
  206.     i%=GetTypeFaceNameFromTTF (SYSDIR$+"mosby.ttf", FontName$, 64)
  207.     CreateIniKeyValue "WIN.INI", "fonts", FontName$+" (TrueType)", "mosby.fot", cmoOverwrite
  208.  
  209.     i%=SendMessage (HWND_BROADCAST, WM_FONTCHANGE, 0, 0)
  210.  
  211.  
  212.     END IF
  213.  
  214.     IF GetListItem(CHECKSTATES$, OPTFILES1) = "ON" THEN
  215.     CreateIniKeyValue MakePath(GetWindowsDir(), "WIN.INI"), "mci extensions", "AVI", "AVIVIDEO", cmoAppend
  216.     ini$ = MakePath(GetWindowsDir(), "SYSTEM.INI")
  217.     CreateIniKeyValue ini$, "mci", "AVIVIDEO", "MCIAVI.DRV", cmoOverwrite
  218.     CreateIniKeyValue ini$, "drivers", "vidc.msvc", "msvidc.drv", cmoNone
  219.     CreateIniKeyValue ini$, "drivers", "vidc.rt21", "indeov.drv", cmoNone
  220.     CreateIniKeyValue getWindowsDir() + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  221.         CreateIniKeyValue getWindowsDir() + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  222.         CreateIniKeyValue getWindowsDir() + "system.ini", "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite
  223.         CreateIniKeyValue getWindowsDir() + "system.ini", "Drivers", "VIDC.IV31", "IR32.dll", cmoOverwrite
  224.         CreateIniKeyValue getWindowsDir() + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
  225.         I% = DoesIniKeyExist (getWindowsDir() + "system.ini", "Drivers", "VIDC.RT21")
  226.         IF I% = 0  THEN
  227.                CreateIniKeyValue getWindowsDir() + "system.ini", "Drivers", "VIDC.RT21", "ir21.dll", cmoOverwrite
  228.         END IF
  229.         CreateIniKeyValue getWindowsDir() + "system.ini", "Drivers", "VIDC.YVU9", "iyvu9.dll", cmoOverwrite
  230.         CreateIniKeyValue "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  231.         CreateIniKeyValue getWindowsDir() + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  232.         CreateIniKeyValue getWindowsDir() + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  233.         CreateIniKeyValue getWindowsDir() + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  234.         CreateIniKeyValue getWindowsDir() + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  235.         CreateIniKeyValue getWindowsDir() + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  236.         CreateIniKeyValue getWindowsDir() + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  237.         CreateIniKeyValue getWindowsDir() + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  238.     ini$ = ""
  239.     run SRCDRV$ + "profdisp.exe"
  240.     
  241.    END IF
  242.     
  243.    
  244.  
  245. QUIT:
  246.     ON ERROR GOTO ERRQUIT
  247.  
  248.     IF ERR = 0 THEN
  249.     dlg% = EXITSUCCESS
  250.     ELSEIF ERR = STFQUIT THEN
  251.     dlg% = EXITQUIT
  252.     ELSE
  253.     dlg% = EXITFAILURE
  254.     END IF
  255. QUITL1:
  256.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  257.     IF sz$ = "REACTIVATE" THEN
  258.     GOTO QUITL1
  259.     END IF
  260.     UIPop 1
  261.  
  262.     END
  263.  
  264. ERRQUIT:
  265.     i% = DoMsgBox("Setup sources were corrupted, call xxx-xxxx!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  266.     END
  267.  
  268.  
  269.  
  270. GETPATH:
  271.     SetSymbolValue "EditTextIn", DEST$
  272.     SetSymbolValue "EditFocus", "END"
  273. GETPATHL1:
  274.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  275.  
  276.     IF sz$ = "CONTINUE" THEN
  277.     olddest$ = DEST$
  278.     DEST$ = GetSymbolValue("EditTextOut")
  279.  
  280.     ''Validate new path.
  281.     IF IsDirWritable(DEST$) = 0 THEN
  282.         GOSUB BADPATH
  283.         GOTO GETPATHL1
  284.     END IF
  285.     UIPop 1
  286.  
  287.     ''Truncate display if too long.
  288.     IF LEN(DEST$) > 23 THEN
  289.         ReplaceListItem DRIVETEXT$, 7, MID$(DEST$, 1, 23)+"..."
  290.     ELSE
  291.         ReplaceListItem DRIVETEXT$, 7, DEST$
  292.     END IF
  293.  
  294.     ''Recalc if path changed.
  295.     IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
  296.         RecalcPath
  297.         SetDriveStatus
  298.     END IF
  299.  
  300.     olddest$ = ""
  301.     GOTO CUSTINST
  302.     ELSEIF sz$ = "REACTIVATE" THEN
  303.     RecalcPath
  304.     SetDriveStatus
  305.     GOTO GETPATHL1
  306.     ELSEIF sz$ = "EXIT" THEN
  307.     GOSUB ASKQUIT
  308.     GOTO GETPATHL1
  309.     ELSE
  310.     UIPop 1
  311.     GOTO CUSTINST
  312.     END IF
  313.  
  314.  
  315.  
  316. OPTFILES1:
  317.     SetSymbolValue "RadioDefault", OPT1OPT$
  318.  
  319. TOOBIG:
  320.     sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
  321.     IF sz$ = "REACTIVATE" THEN
  322.     RecalcPath
  323.     SetDriveStatus
  324.     GOTO TOOBIG
  325.     END IF
  326.     UIPop 1
  327.     RETURN
  328.  
  329.  
  330.  
  331. BADPATH:
  332.     sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  333.     IF sz$ = "REACTIVATE" THEN
  334.     RecalcPath
  335.     SetDriveStatus
  336.     GOTO BADPATH
  337.     END IF
  338.     UIPop 1
  339.     RETURN
  340.  
  341.  
  342.  
  343. ASKQUIT:
  344.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  345.  
  346.     IF sz$ = "EXIT" THEN
  347.     UIPopAll
  348.     ERROR STFQUIT
  349.     ELSEIF sz$ = "REACTIVATE" THEN
  350.     GOTO ASKQUIT
  351.     ELSE
  352.     UIPop 1
  353.     END IF
  354.     RETURN
  355.  
  356.  
  357.  
  358. '**
  359. '** Purpose:
  360. '**     Adds the specified option files to the copy list.
  361. '** Arguments:
  362. '**     ftype%  - type of files to add, one of the following:
  363. '**             ``FILES, OPTFILES1, 
  364. '** Returns:
  365. '**     none.
  366. '*************************************************************************
  367. SUB AddOptFilesToCopyList (ftype%) STATIC
  368.  
  369.     IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
  370.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  371.     IF ftype% = APPFILES THEN
  372.         AddSectionFilesToCopyList "AppFiles", SrcDir$, DEST$
  373.         AddSectionFilesToCopyList "AppSysFi", SrcDir$, GetWindowsSysDir()
  374.         AddSectionFilesToCopyList "AppHelpFiles", SrcDir$, DEST$+"\help"
  375.         AddSectionFilesToCopyList "AppDBFiles", SrcDir$, DEST$+"\DB"
  376.         AddSectionFilesToCopyList "AppWordFiles", SrcDir$, DEST$+"\WORDLIST"
  377.     ELSEIF ftype% = OPTFILES1 THEN
  378.         AddSectionFilesToCopyList "VidSysFi", SrcDir$, GetWindowsSysDir()
  379.         END IF   
  380.     SrcDir$ = ""
  381.     END IF
  382. END SUB
  383.  
  384.  
  385. '**
  386. '** Purpose:
  387. '**     Recalculates disk space for the given option files and sets
  388. '**     the status info symbol "StatusItemsText".
  389. '** Arguments:
  390. '**     ftype% - type of files to add, one of the following:
  391. '**             APPFILES, OPTFILES1, OPTFILES2
  392. '** Returns:
  393. '**     none.
  394. '*************************************************************************
  395. SUB RecalcOptFiles (ftype%) STATIC
  396.     CursorSave% = ShowWaitCursor()
  397.     ClearCopyList
  398.     AddOptFilesToCopyList ftype%
  399.  
  400.     fExtra% = 0
  401.     IF ftype% = APPFILES THEN
  402.     ListSym$ = APPNEEDS$
  403.     IF GetListItem(CHECKSTATES$, APPFILES) = "ON" THEN
  404.         ''Add extra cost to Windows drive for ini/progman, etc.
  405.         ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  406.         ReplaceListItem EXTRACOSTS$, ndrive%, "10240"
  407.         fExtra% = 1
  408.     END IF
  409.     ELSEIF ftype% = OPTFILES1 THEN
  410.     ListSym$ = OPT1NEEDS$
  411.     END IF
  412.  
  413.     StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
  414.  
  415.     cost& = 0
  416.     FOR i% = 1 TO 26 STEP 1
  417.     cost&  = cost& + VAL(GetListItem(ListSym$, i%))
  418.     NEXT i%
  419.     ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
  420.  
  421.     IF StillNeed& > 0 THEN
  422.     ReplaceListItem BIGLIST$, ftype%, "YES"
  423.     ELSE
  424.     ReplaceListItem BIGLIST$, ftype%, ""
  425.     END IF
  426.  
  427.     IF fExtra% THEN
  428.     ReplaceListItem EXTRACOSTS$, ndrive%, "0"
  429.     END IF
  430.     RestoreCursor CursorSave%
  431.     ListSym$ = ""
  432. END SUB
  433.  
  434.  
  435. '**
  436. '** Purpose:
  437. '**     Recalculates disk space and sets option status info according
  438. '**     to the current destination path.
  439. '** Arguments:
  440. '**     none.
  441. '** Returns:
  442. '**     none.
  443. '*************************************************************************
  444. SUB RecalcPath STATIC
  445.  
  446.     CursorSave% = ShowWaitCursor()
  447.  
  448.     RecalcOptFiles APPFILES
  449.     RecalcOptFiles OPTFILES1
  450.   
  451.     RestoreCursor CursorSave%
  452. END SUB
  453.  
  454.  
  455. '**
  456. '** Purpose:
  457. '**     Sets drive status info according to latest disk space calcs.
  458. '** Arguments:
  459. '**     none.
  460. '** Returns:
  461. '**     none.
  462. '*************************************************************************
  463. SUB SetDriveStatus STATIC
  464.  
  465.     drive$ = MID$(DEST$, 1, 1)
  466.     ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
  467.     cost& = VAL(GetListItem(APPNEEDS$, ndrive%)) + VAL(GetListItem(OPT1NEEDS$, ndrive%))
  468.     free& = GetFreeSpaceForDrive(drive$)
  469.     ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
  470.     ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K"
  471.     ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
  472.  
  473.     IF drive$ = WINDRIVE$ THEN
  474.     ReplaceListItem DRIVETEXT$, 4, ""
  475.     ReplaceListItem DRIVETEXT$, 5, ""
  476.     ReplaceListItem DRIVETEXT$, 6, ""
  477.     ELSE
  478.     ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  479.     cost& = VAL(GetListItem(APPNEEDS$, ndrive%)) + VAL(GetListItem(OPT1NEEDS$, ndrive%)) 
  480.     IF cost& = 0 THEN
  481.         ReplaceListItem DRIVETEXT$, 4, ""
  482.         ReplaceListItem DRIVETEXT$, 5, ""
  483.         ReplaceListItem DRIVETEXT$, 6, ""
  484.     ELSE
  485.         free& = GetFreeSpaceForDrive(WINDRIVE$)
  486.         ReplaceListItem DRIVETEXT$, 4, WINDRIVE$ + ":"
  487.         ReplaceListItem DRIVETEXT$, 5, STR$(cost& / 1024) + " K"
  488.         ReplaceListItem DRIVETEXT$, 6, STR$(free& / 1024) + " K"
  489.     END IF
  490.     END IF
  491. END SUB
  492.  
  493.  
  494. '**
  495. '** Purpose:
  496. '**     Appends a file name to the end of a directory path,
  497. '**     inserting a backslash character as needed.
  498. '** Arguments:
  499. '**     szDir$  - full directory path (with optional ending "\")
  500. '**     szFile$ - filename to append to directory
  501. '** Returns:
  502. '**     Resulting fully qualified path name.
  503. '*************************************************************************
  504. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  505.     IF szDir$ = "" THEN
  506.     MakePath = szFile$
  507.     ELSEIF szFile$ = "" THEN
  508.     MakePath = szDir$
  509.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  510.     MakePath = szDir$ + szFile$
  511.     ELSE
  512.     MakePath = szDir$ + "\" + szFile$
  513.     END IF
  514. END FUNCTION
  515.  
  516.